using System;
using System.Drawing;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace LayoutPlanning.Converters
{
    public class RectToMarginConvertor:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!(value is Rectangle))
                return null;
            var rec = (Rectangle) value  ;
            return new Thickness() {Top = rec.Top, Left = rec.Left};
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}